home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / hypnotica / hypnotica.dba next >
Encoding:
Text File  |  2000-06-18  |  2.4 KB  |  157 lines

  1. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2. `          Hypnotica Level 1
  3. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  4. ` By Rich Davey (rich@fatal-design.com)
  5. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  6. ` Music listened  to while  coding this
  7. ` Revive - Bjorn Lynne
  8. ` -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  9. ` Note:
  10. `
  11. ` Not too sure about speed on other 3D
  12. ` cards, but works a treat on my GeForce!
  13.  
  14. sync rate 0
  15. sync on
  16. hide mouse
  17.  
  18. load music "tune1.mid",1
  19. load music "tune2.mid",2
  20. load image "zoneface.bmp",1
  21.  
  22. dim x(300)
  23. dim y(300)
  24.  
  25. for a=0 to 300
  26.  
  27.     x(a)=sin(a)*sin(a)*3*200
  28.     y(a)=cos(a)*sin(a)*1*200+200
  29.  
  30. next a
  31.  
  32. a=0 : tg=50
  33.  
  34. set text font "Courier"
  35.  
  36. loop music 2
  37.  
  38. repeat
  39.  
  40.     cls 0
  41.  
  42.     for b=0 to 40
  43.  
  44.         ink rgb(255-1+b*2,255-1+b*2,255-1+b*2),0
  45.         dot x(b+183-a)+1,y(b+183-a)+1
  46.  
  47.     next b
  48.  
  49.     ink rgb(0,tg,0),rgb(0,0,0)
  50.     center text 300,180,"H Y P N O T I C A"
  51.     center text 300,200,"Press 1 - 5 to select trip"
  52.  
  53.     paste image 1,420+rnd(4),250+rnd(4)
  54.  
  55.     inc a
  56.     if a=183 then a=0
  57.  
  58.     inc tg
  59.     if tg=255 then tg=50
  60.  
  61.     q=scancode()
  62.  
  63.     sync
  64.  
  65. until q>1 and q<7
  66.  
  67. px=16 : py=188 : s=10 : c=0
  68.  
  69. autocam off
  70.  
  71. for a=1 to 40
  72.  
  73.     if q=2 then make object plain a,px,py
  74.     if q=3 then make object cone a,px*3
  75.     if q=4 then make object cylinder a,px*3
  76.     if q=5 then make object sphere a,px*3
  77.     if q=6 then make object cube a,px*3
  78.  
  79.     position object a,a+px,0,50+a+s
  80.  
  81.     ghost object on a
  82.  
  83.     if a=21 then c=10
  84.  
  85.     if a<21
  86.         inc c,10
  87.         color object a,rgb(c,50,255-c)
  88.     else
  89.         inc c,10
  90.         color object a,rgb(255-c,c,50)
  91. `        color object a,rgb(255-c,50,c)
  92.     endif
  93.  
  94. next a
  95.  
  96. `    stuff
  97.  
  98. color backdrop rgb(0,0,0)
  99. position camera 20.5,5,0
  100. set ambient light 100
  101.  
  102. offset=2
  103. speed=2
  104.  
  105. fog#=0
  106. fog_speed=250
  107. fog_timer=timer()
  108. fog_direction=2
  109.  
  110. fog distance 0
  111. fog color rgb(0,0,0)
  112. fog on
  113.  
  114. stop music 2
  115. loop music 1
  116.  
  117. do
  118.  
  119.     for a=1 to 40
  120.         xrotate object a,wrapvalue(b+a*offset)
  121.         if yr=1 then yrotate object a,wrapvalue(b+a*offset)
  122.         zrotate object a,wrapvalue(b+a*offset)
  123.     next a
  124.  
  125.     inc b,speed
  126.     if b=360 then b=0
  127.  
  128.     if timer()<=fog_timer+fog_speed
  129.  
  130.         fog_timer=timer()
  131.  
  132.         if fog_direction=1
  133.             dec fog#,0.5
  134.             if fog#=0
  135.                 fog_direction=2
  136.                 offset=rnd(8)+1
  137.                 speed=rnd(2)+1
  138.                 yr=rnd(1)
  139.             endif
  140.         else
  141.             inc fog#,0.25
  142.             if fog#=250 then fog_direction=1
  143.         endif
  144.  
  145.         fog distance fog#
  146.  
  147.     endif
  148.  
  149.     zrotate camera wrapvalue(b)
  150.  
  151.     if spacekey()=1 then end
  152.  
  153.     sync
  154.  
  155. loop
  156.  
  157.